import { RawCommands } from '@valuation/core'

declare module '@valuation/core' {
  export interface Commands<ReturnType> {
    hello: {

      hello: () => Promise<ReturnType> ;
    };
    hello1: {

      hello1: () => Promise<ReturnType> ;
    };
  }
}

export const hello: RawCommands['hello'] = async () => {
  console.log('hello start')
  return async ({ tr, editor, commands }) => {
    await tr.asyncTransaction(() => {
      tr.setNodeAttribute('1', { isCostDe: 100 })
      tr.addNodeMark('1', editor.schema.marks.color.create())
    })
    await commands.hello1()
  }
}
export const hello1: RawCommands['hello1'] = async () => async () => {
  console.log('hello1')
}
